<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>商品数据</title>
	<link rel="stylesheet" href="css/select2.css">
	<style type="text/css">
		body{width: 1200px;font-size: 16px;font-family: 'Microsoft Yahei',微软雅黑;position: relative;margin:0 auto;}
		.content{float:left;padding:20px;border:2px dashed #ccc;margin-top: 20px}
		.ipt_01{width: 400px;height: 25px;line-height: 25px;padding-left: 20px}
		.item{margin:20px 0;}
		.table2{border:1px solid #ddd;}
		.table2 th{background: #eee;}
		.table2 td{text-align: center;}
		.ipt_02{height: 30px;width: 87px;border:0;outline: 0;line-height: 30px;text-align: center;}
		.sel_01{width: 70px;border-color: #fff;height: 30px;}
		.tac{text-align: center;}
		.err_msg{color: red}
	</style>
	<script src="jquery-1.7.2.min.js"></script>
	<script src="laydate/WdatePicker.js"></script>
	<script src="select2.min.js"></script>
	<script src="js/jquery.validate.min.js"></script>
	<script src="js/messages_zh.js"></script>
	<script src="js/script.js"></script>
</head>
<?php 
	session_start();
	include_once 'includes/init.php';
	if(!empty($_GET['pid'])){
		$sql = "select * from t_product where pid = ".$_GET['pid']." ";
		error_log("SQL: ".$sql);
		$datainfo = $db_Obj->getone($sql);

		$member_id = explode(",", $datainfo['sid']);
		foreach ($member_id as $key => $value) {
			$sql = "select names from t_member where id = ".$value."  ";
			$member_name[] = $db_Obj->getone($sql);
		}

	}
 ?>


<body>
	<div class="head">
		<h2 style="text-align: center;">商品数据</h2>
		<a href="prolist.php" style="margin-left:10px;">返回列表</a><br>
	</div>
	<div class="content" >
		<div>
			<form action="prolist_model.php" method="POST" enctype="multipart/form-data" id="commentForm">
					<input type="hidden" name = 'pro_type' value="1" >
					<input type="hidden" name = 'pid' value="<?php echo $_GET['pid']; ?>">
				  <div class="item">
				    <label  style="margin-left: 10px;">供应商：</label>
					<select multiple="multiple">
					<?php foreach ($member_name as $k_a_k => $v_a_v) { ?>
					    <option ><?php echo $v_a_v['names']; ?></option>
					<?php } ?>
					</select>
				  </div>
				  <div class="item">
				    <label>项目名称：</label>
				    <input type="text" name="project" class="ipt_01" placeholder="例:项目一" value="<?php echo $datainfo['project']; ?>"  required/>
				    <label for="project" class="err_msg"></label>
				  </div>
				  <div class="item">
				  	<label for="">采购类型：</label>
				  	<input type="text"  name="purchase_type" value="<?php echo $datainfo['purchase_type']; ?>">
				  </div>
				  <div class="item">
				    <label>报价截止日期：</label>
				    <input type="text"  name="lasttime" class="ipt_01 lasttime" value="<?php echo date('Y-m-d H:i:s', $datainfo['lasttime']); ?>"  />
				  </div>
				  <div class="item">
				    <label>报价有效时间：</label>
				    <input type="text"  name="validtime" class="ipt_01 val_date" value="<?php echo date('Y-m-d H:i:s', $datainfo['validtime']); ?>" />
				  </div>
				  <div class="item">
				    <label>报价失效时间：</label>
				    <input type="text"  name="invalidtime" class="ipt_01"  value="<?php echo date('Y-m-d H:i:s', $datainfo['invalidtime']); ?>" />
				  </div>
				  <div class="item">
				    <label>竞价状态：</label>
				    <input type="text" value="<?php if($datainfo['status'] == 0 ){ echo "非竞价"; }else{ echo "竞价"; } ?>" id="aa" />
				  </div>
				  <div class="item">
				    <label>密封状态：</label>
				    <input type="text" value="<?php if($datainfo['mifeng'] == 0 ){ echo "非密封"; }else{ echo "密封"; } ?>" id="aa" />
				  </div>
				<div id="putong">
					<div class="item">
					 	<table width="1000" border="1" cellspacing="0" cellpadding="0" class="table2">
					 		<tr>
					 			<th>物料编码</th>
					 			<th width="150">规格型号</th>
					 			<th width="60">计量单位</th>
					 			<th width="60">参考数量</th>
					 			<th>未税目标单价</th>
					 			<th width="30">币种</th>
					 			<th width="70">询价类型</th>
					 			<th width="70">附件</th>
					 			<th width="70">备注</th>
					 			<th width="70">物料组</th>
					 			<th width="70">采购组</th>
					 			<th width="70">工厂</th>
					 			<th width="70">配额</th>
					 		</tr>
					 		<tr class="input_table">
					 			<td><input type="text" name="type" class="ipt_02" value="<?php echo $datainfo['type'] ?>" ></td>
					 			<td><input type="text" name="size" class="ipt_02" value="<?php echo $datainfo['size'] ?>" ></td>
					 			<td>
	 				 				<select name="units" class="sel_01">
	 				 					<option value="">--请选择--</option>
	 							 		<option value="PCS（个）" <?php if($datainfo['units'] == 'PCS（个）' ){ ?> selected = 'selected'  <?php  } ?> >PCS（个）</option>
	 							 		<option value="M（米）" <?php if($datainfo['units'] == 'M（米）' ){ ?> selected = 'selected'  <?php  } ?> >M（米）</option>
	 							 		<option value="Kg（千克）" <?php if($datainfo['units'] == 'Kg（千克）' ){ ?> selected = 'selected'  <?php  } ?> >Kg（千克）</option>
	 							 		<option value="PRS（对）" <?php if($datainfo['units'] == 'PRS（对）' ){ ?> selected = 'selected'  <?php  } ?> >PRS（对）</option>
	 							 		<option value="RL（卷）" <?php if($datainfo['units'] == 'RL（卷）' ){ ?> selected = 'selected'  <?php  } ?> >RL（卷）</option>
	 							 		<option value="SET（套）" <?php if($datainfo['units'] == 'SET（套）' ){ ?> selected = 'selected'  <?php  } ?> >SET（套）</option>
	 							 		<option value="L（升）" <?php if($datainfo['units'] == 'L（升）' ){ ?> selected = 'selected'  <?php  } ?> >L（升）</option>
	 							 		<option value="GAL（加仑）" <?php if($datainfo['units'] == 'GAL（加仑）' ){ ?> selected = 'selected'  <?php  } ?> >GAL（加仑）</option>
	 							 	</select>
					 			</td>
					 			<td><input type="text" name="number" class="ipt_02"  value="<?php echo $datainfo['number']; ?>" ></td>
					 			<td><input type="text" name="price" class="ipt_02" value="<?php echo $datainfo['price']; ?>" ></td>
					 			<td>
					 				<select name="currency" class="sel_01">
					 					<option value="">--请选择--</option>
	 							 		<option value="CNY" <?php if($datainfo['currency'] == 'CNY' ){ ?> selected = 'selected'  <?php } ?> >CNY</option>
	 							 		<option value="USD" <?php if($datainfo['currency'] == 'USD' ){ ?> selected = 'selected'  <?php } ?> >USD</option>
	 							 		<option value="HKD" <?php if($datainfo['currency'] == 'HKD' ){ ?> selected = 'selected'  <?php } ?> >HKD</option>
	 							 	</select>
					 			</td>
					 			<td>
	 				 				<select name="price_type" class="sel_01">
	 				 					<option value="">--请选择--</option>
	 							 		<option value="密封询价" <?php if($datainfo['price_type'] == '密封询价' ){ ?> selected = 'selected'  <?php } ?> >密封询价</option>
	 							 		<option value="非密封竞价" <?php if($datainfo['price_type'] == '非密封竞价' ){ ?> selected = 'selected'  <?php } ?> >非密封竞价</option>
	 							 		<option value="非密封询价" <?php if($datainfo['price_type'] == '非密封询价' ){ ?> selected = 'selected'  <?php } ?> >非密封询价</option>
	 							 	</select>
					 			</td>
					 			<td>
					 				<?php if(!empty($datainfo['file_name'])){  ?>
										<input type="text"  class="ipt_02" name="file_name" value="<?php echo $datainfo['file_name']; ?>" readonly="readonly" >
					 				<?php }else{ ?>
					 					<input type="file" name="file_name" class="ipt_02"  >
					 				<?php } ?>
				 				</td>
					 			<td><input type="text" name="note" class="ipt_02" value="<?php echo $datainfo['note']; ?>" ></td>
					 			<td>
					 				<select name="material" class="sel_01">
					 					<option value="">--请选择--</option>
										<option value="101 线材类" <?php if($datainfo['material'] == '101 线材类' ){ ?> selected = 'selected'  <?php } ?> >101 线材类</option>
										<option value="102 磁材类" <?php if($datainfo['material'] == '102 磁材类' ){ ?> selected = 'selected'  <?php } ?> >102 磁材类</option>
										<option value="103 绝缘类" <?php if($datainfo['material'] == '103 绝缘类' ){ ?> selected = 'selected'  <?php } ?> >103 绝缘类</option>
										<option value="104 金属类" <?php if($datainfo['material'] == '104 金属类' ){ ?> selected = 'selected'  <?php } ?> >104 金属类</option>
										<option value="105 塑胶类" <?php if($datainfo['material'] == '105 塑胶类' ){ ?> selected = 'selected'  <?php } ?> >105 塑胶类</option>
										<option value="106 机械结构件类" <?php if($datainfo['material'] == '106 机械结构件类' ){ ?> selected = 'selected'  <?php } ?> >106 机械结构件类</option>
										<option value="107 光模块结构类" <?php if($datainfo['material'] == '107 光模块结构类' ){ ?> selected = 'selected'  <?php } ?> >107 光模块结构类</option>
										<option value="108 光器件结构类" <?php if($datainfo['material'] == '108 光器件结构类' ){ ?> selected = 'selected'  <?php } ?> >108 光器件结构类</option>
										<option value="109 电路板类" <?php if($datainfo['material'] == '109 电路板类' ){ ?> selected = 'selected'  <?php } ?> >109 电路板类</option>
										<option value="110 阻容感类" <?php if($datainfo['material'] == '110 阻容感类' ){ ?> selected = 'selected'  <?php } ?> >110 阻容感类</option>
										<option value="111 半导体类" <?php if($datainfo['material'] == '111 半导体类' ){ ?> selected = 'selected'  <?php } ?> >111 半导体类</option>
										<option value="112 连接器类" <?php if($datainfo['material'] == '112 连接器类' ){ ?> selected = 'selected'  <?php } ?> >112 连接器类</option>
										<option value="113 电气零部件类" <?php if($datainfo['material'] == '113 电气零部件类' ){ ?> selected = 'selected'  <?php } ?> >113 电气零部件类</option>
										<option value="114 温控组件类" <?php if($datainfo['material'] == '114 温控组件类' ){ ?> selected = 'selected'  <?php } ?> >114 温控组件类</option>
										<option value="115 发电机组" <?php if($datainfo['material'] == '115 发电机组' ){ ?> selected = 'selected'  <?php } ?> >115 发电机组</option>
										<option value="116 管芯类" <?php if($datainfo['material'] == '116 管芯类' ){ ?> selected = 'selected'  <?php } ?> >116 管芯类</option>
										<option value="117 光电芯片类" <?php if($datainfo['material'] == '117 光电芯片类' ){ ?> selected = 'selected'  <?php } ?> >117 光电芯片类</option>
										<option value="118 管芯封装材料" <?php if($datainfo['material'] == '118 管芯封装材料' ){ ?> selected = 'selected'  <?php } ?> >118 管芯封装材料</option>
										<option value="119 光纤连接器" <?php if($datainfo['material'] == '119 光纤连接器' ){ ?> selected = 'selected'  <?php } ?> >119 光纤连接器</option>
										<option value="120 传统光学" <?php if($datainfo['material'] == '120 传统光学' ){ ?> selected = 'selected'  <?php } ?> >120 传统光学</option>
										<option value="121 包材类" <?php if($datainfo['material'] == '121 包材类' ){ ?> selected = 'selected'  <?php } ?> >121 包材类</option>
										<option value="122 印刷品类" <?php if($datainfo['material'] == '122 印刷品类' ){ ?> selected = 'selected'  <?php } ?> >122 印刷品类</option>
										<option value="123 辅料类" <?php if($datainfo['material'] == '123 辅料类' ){ ?> selected = 'selected'  <?php } ?> >123 辅料类</option>
										<option value="124 半成品" <?php if($datainfo['material'] == '124 半成品' ){ ?> selected = 'selected'  <?php } ?> >124 半成品</option>
										<option value="125 成品" <?php if($datainfo['material'] == '125 成品' ){ ?> selected = 'selected'  <?php } ?> >125 成品</option>
										<option value="126 非生产物料" <?php if($datainfo['material'] == '126 非生产物料' ){ ?> selected = 'selected'  <?php } ?> >126 非生产物料</option>
										<option value="127 固定资产" <?php if($datainfo['material'] == '127 固定资产' ){ ?> selected = 'selected'  <?php } ?> >127 固定资产</option>
								 	</select>
					 			</td>
					 			<td>
					 				<select name="purchase" class="sel_01">
					 					<option value="">--请选择--</option>
								 		<option value="8100 生产物料采购组织" <?php if($datainfo['purchase'] == '8100 生产物料采购组织' ){ ?> selected = 'selected'  <?php } ?> >8100 生产物料采购组织</option>
								 		<option value="8200 非生产物料采购组织" <?php if($datainfo['purchase'] == '8200 非生产物料采购组织' ){ ?> selected = 'selected'  <?php } ?> >8200 非生产物料采购组织</option>
								 		<option value="8300 样品采购组织" <?php if($datainfo['purchase'] == '8300 样品采购组织' ){ ?> selected = 'selected'  <?php } ?> >8300 样品采购组织</option>
								 	</select>
					 			</td>
					 			<td>
					 				<select name="plant" class="sel_01">
					 					<option value="">--请选择--</option>
								 		<option value="1101 光电事业部" <?php if($datainfo['plant'] == '1101 光电事业部' ){ ?> selected = 'selected'  <?php } ?> >1101 光电事业部</option>
								 		<option value="1102 能源事业部" <?php if($datainfo['plant'] == '1102 能源事业部' ){ ?> selected = 'selected'  <?php } ?> >1102 能源事业部</option>
								 		<option value="1103 虚拟电子管理部" <?php if($datainfo['plant'] == '1103 虚拟电子管理部' ){ ?> selected = 'selected'  <?php } ?> >1103 虚拟电子管理部</option>
								 		<option value="1201 电子一部+塑膜五金事业部" <?php if($datainfo['plant'] == '1201 电子一部+塑膜五金事业部' ){ ?> selected = 'selected'  <?php } ?> >1201 电子一部+塑膜五金事业部</option>
								 		<option value="1202 RJ连接器事业部" <?php if($datainfo['plant'] == '1202 RJ连接器事业部' ){ ?> selected = 'selected'  <?php } ?> >1202 RJ连接器事业部</option>
								 		<option value="1203 苹果专线" <?php if($datainfo['plant'] == '1203 苹果专线' ){ ?> selected = 'selected'  <?php } ?> >1203 苹果专线</option>
								 		<option value="1204 消费电源事业部" <?php if($datainfo['plant'] == '1204 消费电源事业部' ){ ?> selected = 'selected'  <?php } ?> >1204 消费电源事业部</option>
								 		<option value="1205 空" <?php if($datainfo['plant'] == '1205 空' ){ ?> selected = 'selected'  <?php } ?> >1205 空</option>
								 		<option value="1206 模具" <?php if($datainfo['plant'] == '1206 模具' ){ ?> selected = 'selected'  <?php } ?> >1206 模具</option>
								 	</select>
				 				</td>
					 			<td><input type="text" name="extranum" class="ipt_02" value="<?php echo $datainfo['extranum']; ?>" /></td>
					 		</tr> 
					 	</table>
					</div>
				</div>
				<div style="text-align:center"><input style="width: 50px;margin-right:20px;" type="submit" value="修改"></div>
			</form>
		</div>
	</div>
</body>
</html>
